package cn.wgx.springsecuritystudy.config;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@ControllerAdvice
public class GlobalDefaultExceptionHandler {


    @ExceptionHandler()
    @ResponseBody
    public String defaultErrorHandler(HttpServletRequest req, Exception e) {
        return e.getMessage();
    }

}
